How to Fix XAMPP Port 80 & MySQL Port Conflict Errors

How to Fix XAMPP Port 80 & MySQL Port Conflict Errors

Step-by-step fixes for Windows and macOS — under 5 minutes, no data loss

[Apache] Port 80 in use by "Unable to open process" [MySQL] shutdown unexpectedly

Setting up a local development server with XAMPP is supposed to be quick and simple. But nothing kills your momentum faster than pressing Start and getting hit with a wall of red text: "Port 80 in use by..." or "MySQL shutdown unexpectedly."

If you're staring at a blocked Control Panel right now, you're not alone. This guide explains exactly why these port conflicts happen on Windows and macOS, and walks through the most effective fixes — without touching or corrupting your existing databases.

01

What Is the XAMPP Port 80 / MySQL Error?

When you run XAMPP, two core services need to listen on specific network ports to talk to your browser and your database:

  • Apache (Web Server): defaults to Port 80 (HTTP) and Port 443 (HTTPS).
  • MySQL (Database Engine): defaults to Port 3306.

The "port conflict" error happens when another program or background service on your computer is already using Port 80 or Port 3306. Since a network port can only be used by one application at a time, XAMPP fails to launch.

Note

While Port 80 belongs to Apache, MySQL errors often show up at the same time — because when Apache fails to start, phpMyAdmin can't connect to MySQL either, and the two failures get reported together.

02

Why Does This Error Occur?

Port conflicts are rarely a bug in XAMPP itself. Instead, they're caused by other programs or built-in system services claiming these ports first at startup:

  • World Wide Web Publishing Service (IIS): a built-in Windows web server that automatically locks Port 80.
  • Skype or Discord: older versions of Skype frequently used Ports 80 and 443 for incoming connections.
  • An existing standalone MySQL/MariaDB installation: if you previously installed MySQL manually, or via another stack like WampServer, it holds onto Port 3306.
  • Web deployment tools: VMware, Docker, or the Web Deployment Agent Service can also listen on Port 80.

03

What You'll Need to Fix It

Before applying any fix, make sure you have administrator privileges on your machine.

PlatformRequirementsRecommended Tools
WindowsWindows 10/11, Administrator accessCommand Prompt (cmd), Task Manager
macOSmacOS Catalina or newer, sudo accessTerminal, Activity Monitor
XAMPPXAMPP v8.x or higherXAMPP Control Panel

04

Two Ways to Fix the Error

Way 1 — Stop the conflicting service (recommended)

Free up Port 80 or Port 3306 so XAMPP can use its normal default ports.

Way 2 — Change XAMPP's default ports

Reconfigure XAMPP to run on alternate ports instead — e.g., 8080 for Apache, 3307 for MySQL.

05

Step-by-Step Fix

Way 1: Free Up Port 80 / 3306

  1. Open Services. Press Windows Key + R, type services.msc, and hit Enter.
  2. Find the culprit. Scroll down to World Wide Web Publishing Service.
  3. Stop it. Right-click it and select Stop.
  4. Prevent it from returning. Right-click again, choose Properties, set Startup type to Manual or Disabled, then click Apply.

Or, stop IIS directly from an admin Command Prompt:

net stop w3svc
  1. Open Terminal.
  2. Find what's using Port 80:
    sudo lsof -i :80
  3. Identify the process ID (PID) from the output, then stop it:
    sudo kill -9 <PID>

Way 2: Change Ports in XAMPP's Configuration

If you can't stop whatever's occupying Port 80 or 3306, tell XAMPP to use different ports instead.

Step 1 — Change Apache's port (80 → 8080):

  1. Open the XAMPP Control Panel.
  2. Next to Apache, click Config → Apache (httpd.conf).
  3. Find the line Listen 80 and change it to Listen 8080.
  4. Find ServerName localhost:80 and change it to ServerName localhost:8080.
  5. Save and close the file.

Step 2 — Change MySQL's port (3306 → 3307):

  1. Next to MySQL, click Config → my.ini.
  2. Find port=3306 under both [client] and [mysqld], and change both to port=3307.
  3. Save and close the file.

06

Checking and Verifying Your Fix

  1. Open the XAMPP Control Panel.
  2. Click Start next to Apache and MySQL.
  3. Confirm both rows turn green and show their active process IDs and ports (8080, 3307).
[Apache]  Status change detected: running (Ports: 8080, 443)
[MySQL]   Status change detected: running (Ports: 3307)

Then open your browser and go to http://localhost:8080/dashboard or http://localhost:8080/phpmyadmin to confirm everything's working.

07

Common Problems During the Fix

Problem 1: phpMyAdmin can't connect after changing the MySQL port

Fix Open xampp/phpMyAdmin/config.inc.php, find this line:
$cfg['Servers'][$i]['host'] = 'localhost';
and change it to:
$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';

Problem 2: Port 443 (SSL) conflict error

Fix Open Apache's httpd-ssl.conf file via XAMPP Config, and change Listen 443 to Listen 4433.

08

Tips for Learning SQL

Once your local environment is running again, keep these in mind to speed up your database learning:

  • Start with the CLI first. Before relying entirely on phpMyAdmin, get comfortable with basic terminal commands — SELECT, INSERT, UPDATE, JOIN.
  • Use real sample databases. Practice on realistic datasets like Sakila or Employees rather than tiny test tables.
  • Master normalization. Understanding 1NF, 2NF, and 3NF helps you design efficient schemas from day one.

09

Related Articles on CodeMend

10

Conclusion

Port 80 and Port 3306 conflicts in XAMPP are a common rite of passage for every developer. Whether you disable a conflicting service like IIS, or reconfigure XAMPP to listen on alternate ports like 8080 and 3307, fixing this takes just a few clicks once you understand how network ports work.

11

Frequently Asked Questions

Is it better to stop IIS or change XAMPP's port?

Stopping IIS is generally the better choice if you don't need .NET development — it lets you keep using the standard http://localhost address instead of typing a custom port number every time.

Will changing the MySQL port delete my existing databases?

No. Changing the port configuration only changes how applications connect to MySQL — it doesn't touch or delete your stored data files.

Why does Skype block Port 80?

Older versions of Skype used Ports 80 and 443 as a fallback for HTTP/HTTPS traffic, to get around strict firewalls. This behavior can be turned off in Skype's Advanced Network Settings.

Post a Comment

Previous Post Next Post